<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp" %>
<title>用户注册</title>



</head>

<fieldset id="">

<legend class="layui-btn">账号注册</legend>
 
 <form  class="layui-form" method="post">
 <div class="layui-form-item">
     <label class="layui-form-label">账号</label>
        <div class="layui-input-block">
        <input type= "text" name="account" placeholder="请输入账号" class="layui-input" style="width: 150px;"></input>
        </div>
 </div>
 
<div class="layui-form-item">
   <label class ="layui-form-label">密码</label>
   <div class="layui-input-block">
   <input type="text" name="password" placeholder="请输入密码" class="layui-input" style="width:150px">
   
   </div>
   
</div>
<div class="layui-form-item">
   <label class ="layui-form-label">编号</label>
   <div class="layui-input-block">
   <input type="text" name="teacherId" placeholder="请输入您的教师编号" class="layui-input" style="width:150px">
   
   </div>
   

</div>
<div class="layui-form-item">
   <label class ="layui-form-label">验证码</label>
   <div class="layui-input-block">
   <img src="/StudentMangers/AuthCodeServlet"
			   onclick="this.src ='/StudentMangers/AuthCodeServlet?'+Math.random();"> 
   <input type="text" name="code" placeholder="请输入验证码" class="layui-input" style="width:150px">
   
   </div>
   

</div>


<div class="layui-form-itme">
<input type="button" name ="action" value="注册" lay-submit lay-filter="register" class="layui-btn"></input>
<a href ="/StudentMangers/web/login.jsp" class="layui-btn" >返回登录</a>
<button type="reset"  title="重置"  class="layui-btn">重置</button>

</div>


 </form>
</fieldset>
<script src ="./static/js/base.js"></script>
<script type="text/javascript">

formSubmit("/StudentMangers/RegisterServlet","submit(register)","text",function(data){
	if(data=="注册成功"){
		
		if(confirm("注册成功，是否要返回登录")){
		
			window.location="/StudentMangers/web/login.jsp";
		}
					
	}else{
		layer.alert(data);
	}
})



// form.on("submit(register)",function (data){
	
// 	$.ajax({
// 		type:"post",
// 		data:data.field,
// 		dataType:"text",
// 		url:"/StudentMangers/RegisterServlet",
// 		success:function(data){	
			
			
// 			if(data=="注册成功"){
				
// 				if(confirm("注册成功，是否要返回登录")){
				
// 					window.location="/StudentMangers/web/login.jsp";
// 				}
							
// 			}else{
// 				layer.alert(data);
// 			}
			
// 		}
		
// 	})
	
// })


</script> 

</html>